Converting Parallel Code from Low-Level Abstractions to Higher-Level Abstractions
نویسندگان
چکیده
ions to Higher-Level Abstractions Semih Okur1, Cansu Erdogan1, and Danny Dig2 1 University of Illinois at Urbana-Champaign, USA, {okur2, cerdoga2}@illinois.edu 2 Oregon State University, USA, [email protected] Abstract. Parallel libraries continuously evolve from low-level to higherlevel abstractions. However, developers are not up-to-date with these higher-level abstractions, thus their parallel code might be hard to read, slow, and unscalable. Using a corpus of 880 open-source C# applications, we found that developers still use the old Thread and ThreadPool abstractions in 62% of the cases when they use parallel abstractions. Converting code to higher-level abstractions is (i) tedious and (ii) error-prone. e.g., it can harm performance and silence the uncaught exceptions. We present two automated migration tools, Taskifier and Simplifier that work for C# code. The first tool transforms old style Thread and ThreadPool abstractions to Task abstractions. The second tool transforms code with Task abstractions into higher-level design patterns. Using our code corpus, we have applied these tools 3026 and 405 times, respectively. Our empirical evaluation shows that the tools (i) are highly applicable, (ii) reduce the code bloat, (iii) are much safer than manual transformations. We submitted 66 patches generated by our tools, and the open-source developers accepted 53. Parallel libraries continuously evolve from low-level to higherlevel abstractions. However, developers are not up-to-date with these higher-level abstractions, thus their parallel code might be hard to read, slow, and unscalable. Using a corpus of 880 open-source C# applications, we found that developers still use the old Thread and ThreadPool abstractions in 62% of the cases when they use parallel abstractions. Converting code to higher-level abstractions is (i) tedious and (ii) error-prone. e.g., it can harm performance and silence the uncaught exceptions. We present two automated migration tools, Taskifier and Simplifier that work for C# code. The first tool transforms old style Thread and ThreadPool abstractions to Task abstractions. The second tool transforms code with Task abstractions into higher-level design patterns. Using our code corpus, we have applied these tools 3026 and 405 times, respectively. Our empirical evaluation shows that the tools (i) are highly applicable, (ii) reduce the code bloat, (iii) are much safer than manual transformations. We submitted 66 patches generated by our tools, and the open-source developers accepted 53.
منابع مشابه
Pervasive Parallelism for Managed Runtimes
Modern programming languages like C# or Java are executed in a managed runtime and offer support for concurrency at a high level of abstraction. However, high-level parallel abstractions (e.g., thread pools) can merely be provided as a library since the underlying runtime (including the dynamic compiler) is aware of only a small set of low-level parallel abstractions. In this paper we discuss a...
متن کاملHigh-level languages for low-level programming
ions Abstractions have a cost. File systems and network protocols are generic and not tailored to one particular application. We cannot expect an abstraction to be optimal with respect to every application that uses it. Similarly on the PL side one cannot expect a general purpose PL to provide the exact abstractions needed for one particular application. These abstractions too have a cost: they...
متن کاملTreating a User-Defined Parallel Library as a Domain-Specific Language
The software crisis within scientific computing has been that application codes become larger and more complex. The only conceivable solution is to make application codes smaller and less complex. We know of no way to resolve this crisis, except to make each line of code mean more; this is the process of defining high-level abstractions. Achieving high-performance from high-level abstractions r...
متن کاملAutomated proof-producing abstraction of C code
Before software can be formally reasoned about, it must first be represented in some form of logic. There are two approaches to carrying out this translation: the first is to generate an idealised representation of the program, convenient for reasoning about. The second, safer approach is to perform a precise, conservative translation, at the cost of burdening verification efforts with low-leve...
متن کاملOn Current Chip Multi-processor Systems
The last few years have seen multicore architectures emerge as the defining technology shaping the future of high-performance computing. Although multicore architectures present tremendous performance potential, to realize the true potential of these systems, software needs to play a key role. In particular, high-level language abstractions and the compiler and the operating system should be ab...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 2014